import '@babel/polyfill'
import 'mutationobserver-shim'
import Vue from 'vue'
import './plugins/axios'
import './plugins/fontawesome'
import './plugins/bootstrap-vue'
import App from './App.vue'
import router from './router'
import 'roboto-fontface/css/roboto/roboto-fontface.css'
import '@fortawesome/fontawesome-free/css/all.css'
import config from '@/global/config.js'
import tools from '@/global/tools.js'
import store from './store'
import VueMaterial from 'vue-material'
import 'vue-material/dist/vue-material.min.css'
import 'vue-material/dist/theme/default.css'
import VueCroppie from 'vue-croppie'
import 'croppie/croppie.css'

Vue.use(VueMaterial)
Vue.use(VueCroppie)

Vue.prototype.config = config;
Vue.prototype.tools = tools;

Vue.config.productionTip = false

new Vue({
    router,
    store,
    created() {
        if (localStorage.getItem('token')) {
            store.commit('SET_TOKEN', localStorage.getItem('token'))
            store.commit('SET_USER', JSON.parse(localStorage.getItem('user')))

        }

    },
    render: h => h(App)
}).$mount('#app')